package com.design.singleton;

/**
 * Created by CrazyShaQiuShi on 2017/1/22.
 */
public class SingleObject {
    //创建SingleObject一个对象
    private static SingleObject instance=new SingleObject();
    //让构造方法变成private,这样该类就不会被实例化
    private SingleObject(){}
    //获取唯一的可用对象
    public static  SingleObject getInstance(){
        return instance;
    }
    public void showMessage(){
        System.out.println("Hello World!");
    }
}
